const fs = require("fs");

var json = fs.readFileSync("./Continue Life.json");

var json = JSON.parse(json);

// console.log(json);

var newJson = {};
newJson.music = json.music;
newJson.delay = json.delayed;
newJson.list = [];

for (var i in json.value) {

    var temp = json.value[i];

    var note = {};
    note.id = temp.tag;
    note.time = temp.time;
    note.moveTime = temp.movetime;
    note.type = temp.barrier;

    note.birthY = temp.birth.y;
    note.ext1 = 0;
    if (note.type == noteType.EM_SLUR) {
        note.ext1 = temp.keeptime;
    } else if (note.type == noteType.EM_Fast) {

    }
    newJson.list.push(note);
}

fs.writeFileSync("./ContinueLife.json", JSON.stringify(newJson));